<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The Mongo class [deprecated]</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongopool.setsize.html">« MongoPool::setSize</a></li>
      <li style="float: right;"><a href="mongo.connectutil.html">Mongo::connectUtil »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="mongo.miscellaneous.html">Miscellaneous</a></li>
    <li>The Mongo class [deprecated]</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.mongo" class="reference">

 <h1 class="title">The Mongo class [deprecated]</h1>
 

 <div class="partintro"><p class="verinfo">(PECL mongo &gt;=0.9.0)</p>
  
  <div class="section" id="mongo.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    A connection between PHP and MongoDB.
   </p>
   <p class="para">
    This class extends <a href="class.mongoclient.html" class="classname">MongoClient</a> and provides access to
    several deprecated methods.
   </p>
   <p class="para">
    For backwards compatibility, it also defaults the <code class="literal">&quot;w&quot;</code>
    option of its constructor argument to <code class="literal">0</code>, which does not
    require write operations to be acknowledged by the server. See
    <span class="function"><a href="mongoclient.construct.html" class="function">MongoClient::__construct()</a></span> for more information.
   </p>

    <div class="warning"><strong class="warning">Warning</strong>
     <p class="simpara">
      This class has been <em class="emphasis">DEPRECATED</em> as of version
      1.3.0. Relying on this feature is highly discouraged. Please use
      <a href="class.mongoclient.html" class="classname">MongoClient</a> instead.
     </p>
    </div>
  </div>
  

  <div class="section" id="mongo.synopsis">
   <h2 class="title">Class synopsis</h2>

   
   <div class="classsynopsis">
    <div class="ooclass"></div>

    
    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">Mongo</strong>
     </span>

    <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.mongoclient.html" class="classname">MongoClient</a>
     </span>
     {</div>
    

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">protected</span> <span class="methodname"><a href="mongo.connectutil.html" class="methodname">connectUtil</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="mongo.getpoolsize.html" class="methodname">getPoolSize</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongo.getslave.html" class="methodname">getSlave</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongo.getslaveokay.html" class="methodname">getSlaveOkay</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongo.pooldebug.html" class="methodname">poolDebug</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="mongo.setpoolsize.html" class="methodname">setPoolSize</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$size</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongo.setslaveokay.html" class="methodname">setSlaveOkay</a></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$ok</code><span class="initializer"> = <strong><code>true</code></strong></span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongo.switchslave.html" class="methodname">switchSlave</a></span>(): <span class="type">string</span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.close.html" class="methodname">MongoClient::close</a></span>(<span class="methodparam"><span class="type"><span class="type">bool</span>|<span class="type">string</span></span> <code class="parameter">$connection</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.connect.html" class="methodname">MongoClient::connect</a></span>(): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.dropdb.html" class="methodname">MongoClient::dropDB</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$db</code></span>): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.get.html" class="methodname">MongoClient::__get</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$dbname</code></span>): <span class="type"><a href="class.mongodb.html" class="type MongoDB">MongoDB</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="mongoclient.getconnections.html" class="methodname">MongoClient::getConnections</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.gethosts.html" class="methodname">MongoClient::getHosts</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.getreadpreference.html" class="methodname">MongoClient::getReadPreference</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.getwriteconcern.html" class="methodname">MongoClient::getWriteConcern</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.killcursor.html" class="methodname">MongoClient::killCursor</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$server_hash</code></span>, <span class="methodparam"><span class="type"><span class="type">int</span>|<span class="type"><a href="class.mongoint64.html" class="type MongoInt64">MongoInt64</a></span></span> <code class="parameter">$id</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.listdbs.html" class="methodname">MongoClient::listDBs</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.selectcollection.html" class="methodname">MongoClient::selectCollection</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$db</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$collection</code></span>): <span class="type"><a href="class.mongocollection.html" class="type MongoCollection">MongoCollection</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.selectdb.html" class="methodname">MongoClient::selectDB</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>): <span class="type"><a href="class.mongodb.html" class="type MongoDB">MongoDB</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.setreadpreference.html" class="methodname">MongoClient::setReadPreference</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$read_preference</code></span>, <span class="methodparam"><span class="type">array</span> <code class="parameter">$tags</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.setwriteconcern.html" class="methodname">MongoClient::setWriteConcern</a></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$w</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$wtimeout</code><span class="initializer"> = ?</span></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongoclient.tostring.html" class="methodname">MongoClient::__toString</a></span>(): <span class="type">string</span></div>

   }</div>
   

  </div>


 </div>

 



 
























 

















 





 



<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mongo.connectutil.html">Mongo::connectUtil</a> — Connects with a database server</li><li><a href="mongo.construct.html">Mongo::__construct</a> — The __construct purpose</li><li><a href="mongo.getpoolsize.html">Mongo::getPoolSize</a> — Get pool size for connection pools</li><li><a href="mongo.getslave.html">Mongo::getSlave</a> — Returns the address being used by this for slaveOkay reads</li><li><a href="mongo.getslaveokay.html">Mongo::getSlaveOkay</a> — Get slaveOkay setting for this connection</li><li><a href="mongo.pooldebug.html">Mongo::poolDebug</a> — Returns information about all connection pools</li><li><a href="mongo.setpoolsize.html">Mongo::setPoolSize</a> — Set the size for future connection pools</li><li><a href="mongo.setslaveokay.html">Mongo::setSlaveOkay</a> — Change slaveOkay setting for this connection</li><li><a href="mongo.switchslave.html">Mongo::switchSlave</a> — Choose a new secondary for slaveOkay reads</li></ul>
</div>
</div></div></body></html>